From ebc9e1ccdb7f71badf260898d17c035db8587789 Mon Sep 17 00:00:00 2001 From: "Ian.Campbell@xensource.com" Date: Mon, 27 Feb 2006 10:58:17 +0000 Subject: [PATCH] Support XENFEAT_supervisor_mode_kernel in x86/64 HYPERVISOR_IRET macro Signed-off-by: Ian Campbell --- linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S b/linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S index 6a8e1c0a9f..b2bcfb47e6 100644 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S @@ -51,6 +51,7 @@ #include #include #include +#include #include "irq_vectors.h" @@ -146,16 +147,19 @@ NMI_MASK = 0x80000000 */ .macro HYPERVISOR_IRET flag testb $3,1*8(%rsp) - jnz 1f + jnz 2f testl $NMI_MASK,2*8(%rsp) + jnz 2f + + testb $1,(xen_features+XENFEAT_supervisor_mode_kernel) jnz 1f /* Direct iret to kernel space. Correct CS and SS. */ orb $3,1*8(%rsp) orb $3,4*8(%rsp) - iretq +1: iretq -1: /* Slow iret via hypervisor. */ +2: /* Slow iret via hypervisor. */ andl $~NMI_MASK, 16(%rsp) pushq $\flag jmp hypercall_page + (__HYPERVISOR_iret * 32) -- 2.30.2